import axios from '../request';

export interface RecommendInfo {
  type: number;
  pageSize: number;
}
export interface ProjectDate {
  pageNo: number;
  pageSize: number;
}
export const recommendList = (data: RecommendInfo) => {
  return axios.get<any>(`api/recommend/list/${data.type}?pageSize=${data.pageSize}`, {});
};
// 获取banner列表
/*
type=1首页轮播2登录背景3看展品4模板广场5找设计
*/
export const getBanner = (type: number, pageSize: number) => {
  let str: string = 'login';
  switch (type) {
    case 1:
      str = 'index';
      break;
    case 2:
      str = 'Login';
      break;
    case 3: 
      str = 'Showpiece';
      break;
    case 4: 
      str = 'Template';
      break;
    case 5:
      str = 'Design';
      break;
    case 6:
      str = 'AboutUs';
      break; 
    default:
      break;
  }
  return axios.get<any>(`api/banner/list/${str}/wap?pageSize=${pageSize}`, {});
};
export const listDate = (type: number, parmas: any) => {
  //浏览记录
  let str: string = 'Project';
  switch (type) {
    case 1:
      str = 'Company';
      break; 
    case 2:
      str = 'Curator'; 
      break;
    case 3: 
      str = 'Project';
      break;
    case 4:
      str = 'Showpiece'; 
      break; 
    case 5:
      str = 'Module'; 
      break;
    case 6:
      str = 'Template'; 
      break;
    default:
      str = 'Investigation'; 
      break;
  } 
  return axios.get<any>(`/api/browse/listDate/${str}?pageSize=${parmas.pageSize}&pageNo=${parmas.pageNo}`, {});
};
export const Getfollow = (type:number,data: ProjectDate) => { //我的关注
  let str: string = 'followProjectDate';
  switch (type) {
    case 1: 
      str = 'Company';
      break; 
    case 2:
      str = 'Curator'; 
      break;
    case 3: 
      str = 'followProjectDate';
      break; 
    case 4:
      str = 'followShowpieceDate'; 
      break; 
    case 5:
      str = 'Module'; 
      break;
    case 6:
      str = 'Template'; 
      break;
    default: 
      str = 'Investigation'; 
      break;
  } 
  return axios.get<any>(`api/interact/${str}?PageNo=${data.pageNo}&PageSize=${data.pageSize}`, {});
};
